import { App } from 'vue';
import { registerControlProvider } from '@ibiz-template/runtime';
import { withInstall } from '@ibiz-template/vue3-util';
import { OdooSwimlaneKanban } from './odoo-swimlane-kanban';
import { OdooSwimlaneKanbanProvider } from './odoo-swimlane-kanban.provider';

export const IBizOdooSwimlaneKanban = withInstall(
  OdooSwimlaneKanban,
  function (v: App) {
    v.component(OdooSwimlaneKanban.name!, OdooSwimlaneKanban);
    registerControlProvider(
      'DATAVIEW_RENDER_ODOO_SWIMLANE_KANBAN',
      () => new OdooSwimlaneKanbanProvider(),
    );
  },
);

export default {
  // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/explicit-function-return-type
  install(app: App) {
    app.use(IBizOdooSwimlaneKanban);
  },
};
